// 模拟量
var PageAin2 = {
    id: "PageAin2", //页面id
    menu: "i18n.lan.menu.ain", //所属菜单(一级菜单名)
    title: "i18n.lan.menu.PageAin2", //标题（二级菜单名）
    parentIcon: "icon-me-ain", //图标
    icon: "icon-me-ain", //图标
    refreshBtnCmd: "AIN_DUMPS", //刷新按钮指令
    saveBtn: true, //保存按钮
    el: [ //控件
        {
            elname: "datagrid",
            rowCount: Device.getNodesCount("ain"),
            data: {
                width: "100%",
                frozenColumns: [
                    [{
                        //序号
                        field: 'index',
                        title: i18n.lan.common.index,
                        width: 40,
                        align: "center",
                    },]
                ],
                columns: [
                    [
                        {//报警低值
                            field: "alarmLowVal",
                            width: 70,
                            dumpKey: "AIN<n>NODE_RANGE1",
                            editor: Easyui.editor.numberbox4,
                            dumpParamIndex: 1,
                            cmdKey: "AIN<n>LOW"
                        },
                        {//报警高值
                            field: "alarmHighVal",
                            width: 70,
                            dumpKey: "AIN<n>NODE_RANGE1",
                            editor: Easyui.editor.numberbox4,
                            dumpParamIndex: 0,
                            cmdKey: "AIN<n>HIGH"
                        },
                        {//恢复迟滞
                            field: "recoverLag",
                            editor: Easyui.editor.numberbox4,
                            dumpKey: "AIN<n>NODE_RANGE1",
                            dumpParamIndex: 2,
                            cmdKey: "AIN<n>LAG",
                            width: 70,
                        },
                        {//步长值
                            field: "stepValue",
                            width: 70,
                            dumpKey: "AIN<n>NODE_RANGE2",
                            editor: Easyui.editor.numberbox4,
                            dumpParamIndex: 3,
                            cmdKey: "AIN<n>STEP"
                        },
                        {//再次报警步长
                            field: "alarmStep",
                            editor: Easyui.editor.numberbox4,
                            dumpKey: "AIN<n>NODE_RANGE2",
                            dumpParamIndex: 5,
                            cmdKey: "AIN<n>ALARMSTEP",
                            width: 100,
                        },
                        {//报警确认时间
                            field: "ensureTime",
                            width: 140,
                            dumpKey: "AIN<n>NODE_AETO",
                            editor: Easyui.editor.numberbox,
                            cmdKey: "AIN<n>AETO"
                        },
                        {//报警短信重发时间
                            field: "alarmSmsResendTime",
                            width: 140,
                            dumpKey: "AIN<n>NODE_SMSTO",
                            editor: Easyui.editor.numberbox,
                            dumpParamIndex: 1,
                            cmdKey: "AIN<n>ASRTO"
                        },
                        {//报警暂停时间(最短间隔)
                            field: "stopAlarmTime",
                            width: 140,
                            dumpKey: "AIN<n>NODE_SMSTO",
                            editor: Easyui.editor.numberbox,
                            dumpParamIndex: 0,
                            cmdKey: "AIN<n>ASSTO"
                        },
                        {//定时上传
                            field: "uploadTimer",
                            dumpKey: "AIN<n>NODE_IOTTO",
                            editor: Easyui.editor.numberbox,
                            dumpParamIndex: 0,
                            cmdKey: "AIN<n>IOTTO",
                            width: 140,
                        },
                        {//短信报警
                            field: "smsAlarm",
                            dumpKey: "AIN<n>NODE_PARAM",
                            // formatter:function(value){
                            //     let cb = $("<input type='checkbox'></checkbox>");
                            //     cb[0].checked = (defined(value)&&value);
                            //     return cb.prop("outerHTML");
                            // },
                            formatter: Easyui.formatter.checkbox,
                            editor: Easyui.editor.checkbox,
                            dumpParamIndex: 0,
                            cmdKey: "AIN<n>SMSEN",
                            width: 70,
                            align: "center",
                        },
                        {//恢复短信
                            field: "recoverSms",
                            formatter: Easyui.formatter.checkbox,
                            editor: Easyui.editor.checkbox,
                            dumpKey: "AIN<n>NODE_PARAM",
                            dumpParamIndex: 2,
                            cmdKey: "AIN<n>SMSREN",
                            width: 70,
                            align: "center",
                        },
                        {//断开短信
                            field: "disconnSms",
                            formatter: Easyui.formatter.checkbox,
                            editor: Easyui.editor.checkbox,
                            dumpKey: "AIN<n>NODE_PARAM",
                            dumpParamIndex: 3,
                            cmdKey: "AIN<n>SMSDISCONNEN",
                            width: 70,
                            align: "center",
                        },
                        {//声音报警
                            field: "soundAlarm",
                            align: "center",
                            width: 70,
                            dumpKey: "AIN<n>NODE_PARAM",
                            formatter: Easyui.formatter.checkbox,
                            editor: Easyui.editor.checkbox,
                            dumpParamIndex: 1,
                            cmdKey: "AIN<n>SOUNDEN"
                        },
                    ]
                ]
            },
        },
        {
            elname: "text",
            label: i18n.lan.PageAin.powerUploadTime,
            attrs: {
                dumpKey: "AIN4NODE_IOTTO",
                cmdKey: "AIN4IOTTO",
                dumpParamIndex: 0,
            },
            endRow: true,
        },
    ],
}
CmdPage.add(PageAin2); //添加到页面管理
